#
# @lc app=leetcode.cn id=119 lang=python3
#
# [119] 杨辉三角 II
#

# @lc code=start
class Solution:
    def getRow(self, rowIndex: int) -> List[int]:
        if rowIndex == 1:
            return [1,1]
        elif rowIndex == 0:
            return [1]
        ang=[[1],[1,1]]
        for i in range(2,rowIndex+1):
            ang.append([])
            for j in range(0,i+1):
                if j==0 or j==i:
                    ang[i].append(1)
                else:
                    ang[i].append(ang[i-1][j-1]+ang[i-1][j])
        return ang[rowIndex]
# @lc code=end

